import { ActionType } from '@/types/event';
import { v4 as uuidv4 } from 'uuid';

/**
 * 缺省的动作配置
 */
export const getDefaultActionConfig = () => ({
  id: uuidv4(),
  type: '',
  target: '',
  method: '',
  value: {},
});

/**
 * 动画缓动效果
 */
type EaseType = 'easeInQuad' | 'easeOutQuad' | 'easeInOutQuad' | 'linear';

/**
 * 动画缓动效果选项
 */
export const EaseTypeOptions: { label: string; value: EaseType }[] = [
  {
    label: '线性',
    value: 'linear',
  },
  {
    label: '缓入',
    value: 'easeInQuad',
  },
  {
    label: '缓出',
    value: 'easeOutQuad',
  },
  {
    label: '缓入缓出',
    value: 'easeInOutQuad',
  },
];

/**
 * 目标对象选项
 */
export const ActionTypeOptions: { label: string; value: ActionType }[] = [
  {
    label: '场景',
    value: 'stage',
  },
  {
    label: '面板',
    value: 'panel',
  },
];

/**
 * 剖切速度选项
 */
export const ClipSpeedOptions: { label: string; value: number }[] = [
  {
    label: '0.5X',
    value: 0.5,
  },
  {
    label: '0.8X',
    value: 0.8,
  },
  {
    label: '1X',
    value: 1,
  },
  {
    label: '1.5X',
    value: 1.5,
  },
  {
    label: '2X',
    value: 2,
  },
];

/**
 * 剖切次数选项
 */
export const ClipTimesOptions: { label: number; value: number }[] = [...Array(10)].map((o, i) => {
  const times = i + 1;
  return { label: times, value: times };
});
